import FieldProps, {type IFieldProps} from '../../basic/FieldProps'

export interface IRateProps extends IFieldProps{
  allowHalf?: boolean|undefined,
  count?: number|undefined,
}
export default class RateProps extends FieldProps implements IRateProps{
  public allowHalf = false;
  public count = 5;

  constructor(props?:IRateProps) {
    super({
      widgetLabel: "评分",
      widgetType:"RATE",
      ...(props||{})
    });
    if(props){
      this.allowHalf = props.allowHalf?props.allowHalf:this.allowHalf;
      this.count = !isNaN(props.count as any)?props.count:this.count as any;
    }
  }
}
